package com.fisionlabs.analizer.chain.link;

import com.fisionlabs.queue.PacketQueue;

import jpcap.packet.ICMPPacket;
import jpcap.packet.Packet;

public class ICMPLink extends PacketLink{
	public ICMPLink(){
		
	}
	
	@Override
	public boolean action(Packet packet) {
       if (packet instanceof ICMPPacket) 
       {
    	   System.out.println("ICMP Packet");
    	   ICMPPacket icmpPacket = (ICMPPacket)packet;
    	   PacketQueue.getInstance().addPacket(icmpPacket);
    	   
    	   return true;
       }
       else
          if (next != null) 
          	next.action(packet);
       
       return false;
	}	
}
